package com.flash.InventoryManagement.mapper;

import com.flash.InventoryManagement.entity.CashStock;
import com.flash.InventoryManagement.entity.TaStock;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
 * @author jr
 * @version 1.0
 * @date 2022/9/1
 */
@Mapper
public interface TaStockMapper {

    @Select("select count(*) from TaStock")
    public int countTaStock();

    @Select("select * from (select rownum rn,t.* from taStock t) where 1=1 ${strWhere} and rn between #{page} and #{limit}")
    public List<TaStock> selectTaStock(Map map);

    @Insert("insert into taStock values(#{securityAccrualStockId},#{fundId},#{dateTAStock},#{initialState},#{quantity},#{money},#{remark})")
    public int insertTaStock(TaStock taStock);

    @Delete("delete from taStock where securityAccrualStockId=#{securityAccrualStockId}")
    public int deleteTaStock(TaStock taStock);

    @Update("update taStock set fundId=#{fundId},dateTAStock=#{dateTAStock},initialState=#{initialState},quantity=#{quantity},money=#{money},remark=#{remark} where securityAccrualStockId=#{securityAccrualStockId}")
    public int updateTaStock(TaStock taStock);
}
